<a href="<{$url}>" onclick="return doTemplate(this);" ><{t}>筛选商品<{/t}></a>
<div class="gridlist rows-body">
<{if $arr_products}>
<{foreach from=$arr_products item=item}>
  <div class="row-line" id="item_<{$item.goods_id}>">
    <{img class="operater" alt=$___b2c="删除"|t:'b2c' src="icons/icon_delete.gif" onclick="this.getParent('div').destroy();" }>
    <input type="hidden"  value="<{$item.goods_id}>" >
    <label for="edit_sel_5f1f33_0"><{$item.gname}></label>
  </div>
<{/foreach}>
<{/if}>
</div>
<script>

function doTemplate(obj) {
    new Dialog(
                obj.href,
                {
                    width:550, 
                    height:450, 
                    title:obj.get('html'),
                    callback:function(e){
                        e.getElements('input[type=checkbox]').each(function(item){
                            if(item.checked) {
                            	var _item_name = 'item_' + item.get('value');
                            	if(!document.getElementById(_item_name)) {
	                                var _div_element = new Element('div', {class:'row-line',id:_item_name});
	                                var _input_element = new Element('input', {type:'hidden', value:item.get('value'), name:'{$aData['name']}[]'});
	                                var _lable_element = new Element('label', {html:item.getNext('label').get('html')});
	                                var _img_element = new Element('img', {class:'operater', src:e.getElement('img').get('src'), onclick:"this.getParent('div').destroy();"});
	                                _div_element.adopt(_img_element, _input_element, _lable_element);
	                                obj.getNext('div').adopt(_div_element);
	                            }
                            }
                        });
                    }
                }
            );
    return false;
}
</script>